
#ifndef __PN532_HardwareSerial_H__
#define __PN532_HardwareSerial_H__

#include "PN532Interface.hpp"

#define PN532_TXD               CONFIG_PN532_TXD
#define PN532_RXD               CONFIG_PN532_RXD
#define PN532_UART_NUM          CONFIG_PN532_UART_NUM
#define PN532_UART_RATE         CONFIG_PN532_UART_RATE
#define PN532_UART_RECVBUFFSISE CONFIG_PN532_UART_RECVBUFFSISE
#define PN532_UART_SENDBUFFSISE CONFIG_PN532_UART_SENDBUFFSISE

#define PN532_EN_PIN            10
#define PN532_PIN_RSTOUT_N      13
#define PN532_PIN_IRQ           14



namespace idf {

namespace pn532 {

class PN532_HardwareSerial
{
public:
    PN532_HardwareSerial();
    void Init(void);
    int write(uint8_t ucByte);
    size_t available(void);
    uint8_t read(void);
    int sendData(const void *src, size_t size);
    int recvData(void *buf,uint32_t length,uint16_t ms_to_wait);
private:
    int uart_initFlag;
    size_t iRLen;
};

} // namespace

} // namespace 

#endif
